<template>

  <section class="receipt-address">
    <AddressHeader :title="title"></AddressHeader>
		<div class="Receiving_box">
			<span>配送地址</span>
			<router-link to="/AddReceiptAddress">
				<span>+增加配送地址</span>
			</router-link>
		</div>
  </section>

</template>

<script>
import axios from 'axios'
import AddressHeader from "./Address_header.vue";
export default {
  name: "receipt-address",
  props: [],
  mounted() {},
  data() {
    return {
      title:'选择收货地址',
      arr:[]
    };
  },
  created(){
    var url = "http://vueshop.glbuys.com/api/user/address/index?uid=696443691&token=1ec949a15fb709370f"
    axios.get(url).then((res) => {
      console.log(res.data)
      // var arr = this.res.data
    })
  },
  components: {
    AddressHeader: AddressHeader
  },
  methods: {
    back() {
      if (window.history.length <= 1) {
        this.$router.push({
          path: "/"
        });
        return false;
      } else {
        this.$router.push({ path: "/ConfirmOrder" });
      }
      //上面都没执行就说明卡在当前页不是最后一条， histroy记录数量大于1，又没有回退记录，只能返回首页，
      //如果上面都执行了 页面都跳走了，这个也就不用管了
      setTimeout(() => {
        this.$router.push({
          path: "/ConfirmOrder"
        });
      }, 0);
    }
  },
  computed: {}
};
</script>

<style scoped>
.receipt-address {
  width: 100%;
  overflow: hidden;
}


.Receiving_box {
  width: 100%;
  height: 0.78rem;
  background: #d3c6be;
}

.Receiving_box span:nth-last-child(2) {
  color: #3d3336;
  font-size: 0.3rem;
  margin-left: 0.22rem;
}

.Receiving_box span:nth-last-child(1) {
  color: #3d3336;
  font-size: 0.3rem;
  margin-left: 3.6rem;
  line-height: 0.78rem;
}
</style>
